Programming with MicroPython: Embedded Programming with Microcontrollers and Python by Nicholas H. Tollervey
Author:Nicholas H. Tollervey [Tollervey, Nicholas H.]
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media
Published: 2017-09-25T05:00:00+00:00
from microbit import * while True: if accelerometer.was_gesture('shake'): display.show(Image.ANGRY) elif accelerometer.was_gesture('face up'): display.show(Image.ASLEEP) elif accelerometer.was_gesture('up'): display.show(Image.HAPPY) sleep(100)
If the device is shaken, it displays an angry face; if it is flat but face up, it appears asleep; and if it is held upright, it’s happy to see you. The micro:bit can recognise the following list of gestures: up, down, left, right, face up, face down, freefall, 3g, 6g, 8g, and shake.
The micro:bit is the only device with an onboard magnetometer. It’s not very accurate and requires calibration before use. Calibration is achieved via the compass.calibrate method, which causes the device to wait until you’ve drawn a blocky circle on the display by rotating the device to move a pixel around the screen. Once calibrated, the micro:bit is able to report a heading with 0 as “north” (or some other strong magnetic field). Here’s how to turn the device into a compass that displays where the micro:bit thinks north is:
Download
Programming with MicroPython: Embedded Programming with Microcontrollers and Python by Nicholas H. Tollervey.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Whiskies Galore by Ian Buxton(41453)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32826)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32510)
Craft Beer for the Homebrewer by Michael Agnew(17879)
Turbulence by E. J. Noyes(7618)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7069)
Kaplan MCAT General Chemistry Review by Kaplan(6504)
The Thirst by Nesbo Jo(6370)
Bad Blood by John Carreyrou(6220)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6183)
Learning SQL by Alan Beaulieu(5960)
Weapons of Math Destruction by Cathy O'Neil(5722)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5519)
Digital Minimalism by Cal Newport;(5271)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5102)
iGen by Jean M. Twenge(5094)
Secrets of Antigravity Propulsion: Tesla, UFOs, and Classified Aerospace Technology by Ph.D. Paul A. Laviolette(4809)
Design of Trajectory Optimization Approach for Space Maneuver Vehicle Skip Entry Problems by Runqi Chai & Al Savvaris & Antonios Tsourdos & Senchun Chai(4781)
Electronic Devices & Circuits by Jacob Millman & Christos C. Halkias(4658)
